#pragma once
#include <functional>
#include <SFML/System/Time.hpp>
#include <SFML/System/Vector2.hpp>

template <typename T>
class Distribution
{
public:
    Distribution() = delete;
    template <typename U>
    Distribution(U constant):
        producer(constant)
    {
    }
public:
    T operator()() const
    {
        return producer();
    }
private:
    typedef std::function<T()> Producer;
    Producer producer;
};

int random(int min, int max);
uint32_t random(uint32_t min, uint32_t max);
float random(float min, float max);
float randomDev(float middle,float deviation);

Distribution<int> uniform(int min, int max);
Distribution<uint32_t> uniform(uint32_t min,uint32_t max);
Distribution<float> uniform(float min, float max);
Distribution<sf::Time> uniform(const sf::Time& min,const sf::Time& max);

Distribution<sf::Vector2f> rect(const sf::Vector2f& center, const sf::Vector2f& halfSize);
Distribution<sf::Vector2f> circle(const sf::Vector2f& center, float radius);
